home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-12-20 | 2.4 KB | 75 lines | [TEXT/CWIE] |
- ///////////////////////////////////////////////////////////////////////////////
- //
- // CBaseEventClient.h
- //
- //
-
- #ifndef __CBaseEventClient__
- #define __CBaseEventClient__
-
- #include "BDInterfaces.h"
-
- ///////////////////////////////////////////////////////////////////////////////
- //
- // Constants
- //
-
- const char MAX_NUM_SOURCE_CONTROLS = 50; // an arbitrary limit. We could make this dynamic.
- const char SOURCEOBJECT_STR[] = "sourceobject";
-
- ///////////////////////////////////////////////////////////////////////////////
- //
- // class declaration
- //
-
- class CBaseEventClient :
- public CBaseCOM,
- public IPersistPropertyBag
- {
- public:
-
- // Initialization
- CBaseEventClient(void);
- ~CBaseEventClient();
-
- // *** IUnknown methods ***
- STDMETHOD (QueryInterface)(REFIID inRefID, void** outObj);
- STDMETHOD_ (Uint32, AddRef)(void) { return CBaseCOM::AddRef(); }
- STDMETHOD_ (Uint32, Release)(void) { return CBaseCOM::Release(); }
-
- // *** IPersist methods ***
- STDMETHOD (GetClassID)(CLSID* classID)
- { return ResultFromScode(E_NOTIMPL); }
-
- // *** IPersistPropertyBag methods ***
- STDMETHOD (InitNew)(void)
- { return ResultFromScode(S_OK); }
- STDMETHOD (Load)(IPropertyBag* propertyBag, IErrorLog* errorLog);
- STDMETHOD (Save)(IPropertyBag* propertyBag, BOOL clearDirty, BOOL saveAllProperties)
- { return ResultFromScode(E_NOTIMPL); }
-
- // Methods involving connecting to other controls (by name).
- protected:
- virtual Boolean AddIncomingInterface(IID incomingInterfaceID);
- virtual void SetUpConnections(IContainerSite * containerSite, IContainer * container);
- virtual Boolean IsSource(IUnknown * unk);
- virtual Boolean IsSource(char * sourceName);
- virtual void SetSourceName(char * theName);
- virtual void AddDesiredSourceName(char * theName);
- virtual Boolean AddSource(char * sourceName);
-
- protected:
- IID mIncomingInterfaceID;
- char * mSourceName;
- char * mDesiredSources[MAX_NUM_SOURCE_CONTROLS]; // the ids of the specific controls that we want to get messages from
- char * mFoundSources[MAX_NUM_SOURCE_CONTROLS]; // the ids of the specific controls that we've connected to
- long mNumDesiredSources;
- long mNumFoundSources;
- DWORD m_Cookie;// NOTE: if we ever actually use this for something, we need a
- // list of them, since we allow connections to more than
- // one specific sources.
- Boolean mConnectingComplete;
- };
-
- #endif // __CBaseEventClient__
-